
#include "SDL_image.h"

#include "ddc_error.h"
#include "ddc_internal.h"
#include "ddc_texture.h"

// DDC_BaseSDLTexture {

DDC_BaseSDLTexture::~DDC_BaseSDLTexture() {
    SDL_DestroyTexture(baseTexture);
}

DDC_BaseSDLTexture *DDC_BaseSDLTexture::LoadFromFile(const char *fileName) {
    SDL_Texture *texture = IMG_LoadTexture(__gDodocoMainRenderer, fileName);

    if (!texture) {
        _DDC_ErrSetString(SDL_GetError());
        return nullptr;
    }

    DDC_BaseSDLTexture *bst = new DDC_BaseSDLTexture(texture);

    return bst;
}

// } DDC_BaseSDLTexture
